<!DOCTYPE html>
<html lang="en">
  <head>
    <title>CodableHelpers Structure Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Struct/CodableHelpers" class="dashAnchor"></a>

    <a title="CodableHelpers Structure Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          Kitura Docs
        </a>
         (99% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/Kitura/Kitura/">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">Kitura Reference</a>
      <img class="carat" src="../img/carat.png" />
      CodableHelpers Structure Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/BodyParser.html">BodyParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/BodyParserMultiValue.html">BodyParserMultiValue</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ContentType.html">ContentType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Kitura.html">Kitura</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Router.html">Router</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterMiddlewareGenerator.html">RouterMiddlewareGenerator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterRequest.html">RouterRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterResponse.html">RouterResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer.html">StaticFileServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer/CacheOptions.html">– CacheOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer/Options.html">– Options</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/JSONPError.html">JSONPError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/LinkParameter.html">LinkParameter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/ParsedBody.html">ParsedBody</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/RouterMethod.html">RouterMethod</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/DecodingError.html">DecodingError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/ResponseHeadersSetter.html">ResponseHeadersSetter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/RouterMiddleware.html">RouterMiddleware</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/TypeSafeMiddleware.html">TypeSafeMiddleware</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AdditionalCookieAttribute.html">AdditionalCookieAttribute</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/CodableHelpers.html">CodableHelpers</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Headers.html">Headers</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MediaType.html">MediaType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MediaType/TopLevelType.html">– TopLevelType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Part.html">Part</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Part/HeaderType.html">– HeaderType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/SSLConfig.html">SSLConfig</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/SwaggerDocument.html">SwaggerDocument</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura16LifecycleHandlera">LifecycleHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura13RouterHandlera">RouterHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura22RouterParameterHandlera">RouterParameterHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura13ServerOptionsa">ServerOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura17WrittenDataFiltera">WrittenDataFilter</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>CodableHelpers</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">CodableHelpers</span></code></pre>

                </div>
              </div>
            <p>Building blocks for Codable routing, intended for convenience when implementing
extensions to the <code><a href="../Classes/Router.html">Router</a></code> that interoperate with <code>Codable</code> types.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV17isContentTypeJSONySbAA13RouterRequestCFZ"></a>
                    <a name="//apple_ref/swift/Method/isContentTypeJSON(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV17isContentTypeJSONySbAA13RouterRequestCFZ">isContentTypeJSON(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if the given request has content type JSON</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">isContentTypeJSON</span><span class="p">(</span><span class="n">_</span> <span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterRequest.html">RouterRequest</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The RouterRequest to check</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>True if the content type of the request is application/json, false otherwise</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV23isContentTypeURLEncodedySbAA13RouterRequestCFZ"></a>
                    <a name="//apple_ref/swift/Method/isContentTypeURLEncoded(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV23isContentTypeURLEncodedySbAA13RouterRequestCFZ">isContentTypeURLEncoded(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if the given request has content type x-www-form-urlencoded</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">isContentTypeURLEncoded</span><span class="p">(</span><span class="n">_</span> <span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterRequest.html">RouterRequest</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The RouterRequest to check</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>True if the content type of the request is application/x-www-form-urlencoded, false otherwise</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV14httpStatusCode4from0A3Net010HTTPStatusF0O0A9Contracts12RequestErrorV_tFZ"></a>
                    <a name="//apple_ref/swift/Method/httpStatusCode(from:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV14httpStatusCode4from0A3Net010HTTPStatusF0O0A9Contracts12RequestErrorV_tFZ">httpStatusCode(from:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Get the HTTPStatusCode corresponding to the provided RequestError</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">httpStatusCode</span><span class="p">(</span><span class="n">from</span> <span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>from</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The RequestError to map to a HTTPStatusCode</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A HTTPStatusCode corresponding to the RequestError http code
        if valid, or HTTPStatusCode.unknown otherwise</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV22constructResultHandler8response10completiony0A9Contracts12RequestErrorVSgcAA14RouterResponseC_yyctFZ"></a>
                    <a name="//apple_ref/swift/Method/constructResultHandler(response:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV22constructResultHandler8response10completiony0A9Contracts12RequestErrorVSgcAA14RouterResponseC_yyctFZ">constructResultHandler(response:<wbr>completion:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a closure that can be called by a codable route handler that
 provides only an optional <code><a href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a></code></p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will create a closure that can be passed to the registered
     route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">constructResultHandler</span><span class="p">(</span><span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">ResultClosure</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> to which the codable response error and
                   status code will be written</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The completion to be called after the returned
                     closure completes execution.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The closure to pass to the codable route handler. The closure takes one argument
        <code>(RequestError?)</code>.
        If the argument is <code>nil</code> then the response will be considered successful, otherwise
        it will be considered failed.</p>
<pre class="highlight swift"><code>    <span class="kt">If</span> <span class="n">successful</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="err">`</span><span class="kt">HTTPStatusCode</span><span class="o">.</span><span class="n">noContent</span><span class="err">`</span> <span class="n">and</span> <span class="n">no</span>
    <span class="n">body</span> <span class="n">will</span> <span class="n">be</span> <span class="n">sent</span><span class="o">.</span>

    <span class="kt">If</span> <span class="n">failed</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">used</span> <span class="k">for</span> <span class="n">the</span> <span class="n">response</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="n">either</span> <span class="n">the</span>
    <span class="p">`</span><span class="nv">httpCode</span><span class="p">`</span> <span class="n">of</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`,</span> <span class="k">if</span> <span class="n">that</span> <span class="k">is</span> <span class="n">a</span> <span class="n">valid</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span><span class="p">,</span> <span class="n">or</span>
    <span class="err">`</span><span class="kt">HTTPStatusCode</span><span class="o">.</span><span class="n">unknown</span><span class="err">`</span> <span class="n">otherwise</span><span class="o">.</span> <span class="kt">If</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`</span> <span class="n">has</span> <span class="n">a</span> <span class="n">codable</span> <span class="p">`</span><span class="nv">body</span><span class="p">`</span> <span class="n">then</span>
    <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>
</code></pre>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV25constructOutResultHandler13successStatus8response10completionyxSg_0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctSeRzSERzlFZ"></a>
                    <a name="//apple_ref/swift/Method/constructOutResultHandler(successStatus:response:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV25constructOutResultHandler13successStatus8response10completionyxSg_0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctSeRzSERzlFZ">constructOutResultHandler(successStatus:<wbr>response:<wbr>completion:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a closure that can be called by a codable route handler that
 provides an optional <code>Codable</code> body and an optional <code><a href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a></code></p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will create a closure that can be passed to the registered
     route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">constructOutResultHandler</span><span class="o">&lt;</span><span class="kt">OutputType</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">successStatus</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></span> <span class="o">=</span> <span class="o">.</span><span class="kt">OK</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">CodableResultClosure</span><span class="o">&lt;</span><span class="kt">OutputType</span><span class="o">&gt;</span> <span class="k">where</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>successStatus</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></code> to use for a successful response (see below)</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> to which the codable response body (or codable
                   error) and status code will be written</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The completion to be called after the returned
                     closure completes execution.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The closure to pass to the codable route handler. The closure takes two arguments
        <code>(OutputType?, RequestError?)</code>.
        If the second (error) argument is <code>nil</code> then the first (body) argument should be non-<code>nil</code>
        and the response will be considered successful. If the second (error) argument is non-<code>nil</code>
        then the first argument is ignored and the response is considered failed.</p>
<pre class="highlight swift"><code>    <span class="kt">If</span> <span class="n">successful</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="p">`</span><span class="nv">successStatus</span><span class="p">`</span> <span class="n">and</span> <span class="n">the</span> <span class="p">`</span><span class="nv">CodableResultClosure</span><span class="p">`</span> <span class="n">output</span>
    <span class="n">will</span> <span class="n">be</span> <span class="kt">JSON</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>

    <span class="kt">If</span> <span class="n">failed</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">used</span> <span class="k">for</span> <span class="n">the</span> <span class="n">response</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="n">either</span> <span class="n">the</span>
    <span class="p">`</span><span class="nv">httpCode</span><span class="p">`</span> <span class="n">of</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`,</span> <span class="k">if</span> <span class="n">that</span> <span class="k">is</span> <span class="n">a</span> <span class="n">valid</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span><span class="p">,</span> <span class="n">or</span>
    <span class="err">`</span><span class="kt">HTTPStatusCode</span><span class="o">.</span><span class="n">unknown</span><span class="err">`</span> <span class="n">otherwise</span><span class="o">.</span> <span class="kt">If</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`</span> <span class="n">has</span> <span class="n">a</span> <span class="n">codable</span> <span class="p">`</span><span class="nv">body</span><span class="p">`</span> <span class="n">then</span>
    <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>
</code></pre>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV35constructTupleArrayOutResultHandler13successStatus8response10completionySayx_q_tGSg_0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctAJ10IdentifierRzSeR_SER_r0_lFZ"></a>
                    <a name="//apple_ref/swift/Method/constructTupleArrayOutResultHandler(successStatus:response:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV35constructTupleArrayOutResultHandler13successStatus8response10completionySayx_q_tGSg_0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctAJ10IdentifierRzSeR_SER_r0_lFZ">constructTupleArrayOutResultHandler(successStatus:<wbr>response:<wbr>completion:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a closure that can be called by a codable route handler that
 provides an array of tuples of (Identifier, Codable) and an optional <code><a href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a></code></p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will create a closure that can be passed to the registered
     route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">constructTupleArrayOutResultHandler</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">OutputType</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">successStatus</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></span> <span class="o">=</span> <span class="o">.</span><span class="kt">OK</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">IdentifierCodableArrayResultClosure</span><span class="o">&lt;</span><span class="kt">Id</span><span class="p">,</span> <span class="kt">OutputType</span><span class="o">&gt;</span> <span class="k">where</span> <span class="kt">Id</span> <span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>successStatus</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></code> to use for a successful response (see below)</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> to which the codable response body (or codable
                   error) and status code will be written</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The completion to be called after the returned
                     closure completes execution.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The closure to pass to the codable route handler. The closure takes two arguments
        <code>([(Id, OutputType)]?, RequestError?)</code>.
        If the second (error) argument is <code>nil</code> then the first argument (body) should be non-<code>nil</code>
        and the response will be considered successful. If the second (error) argument is non-<code>nil</code>
        then the first argument is ignored and the response is considered failed.</p>
<pre class="highlight swift"><code>    <span class="kt">If</span> <span class="n">successful</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="p">`</span><span class="nv">successStatus</span><span class="p">`</span> <span class="n">and</span> <span class="n">the</span> <span class="p">`</span><span class="nv">IdentifierCodableArrayResultClosure</span><span class="p">`</span> <span class="n">output</span>
    <span class="n">will</span> <span class="n">be</span> <span class="kt">JSON</span> <span class="n">encoded</span> <span class="k">as</span> <span class="n">an</span> <span class="n">array</span> <span class="n">of</span> <span class="n">dictionaries</span><span class="p">,</span> <span class="n">which</span> <span class="k">is</span> <span class="n">then</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>

    <span class="kt">If</span> <span class="n">failed</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">used</span> <span class="k">for</span> <span class="n">the</span> <span class="n">response</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="n">either</span> <span class="n">the</span>
    <span class="p">`</span><span class="nv">httpCode</span><span class="p">`</span> <span class="n">of</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`,</span> <span class="k">if</span> <span class="n">that</span> <span class="k">is</span> <span class="n">a</span> <span class="n">valid</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span><span class="p">,</span> <span class="n">or</span>
    <span class="err">`</span><span class="kt">HTTPStatusCode</span><span class="o">.</span><span class="n">unknown</span><span class="err">`</span> <span class="n">otherwise</span><span class="o">.</span> <span class="kt">If</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`</span> <span class="n">has</span> <span class="n">a</span> <span class="n">codable</span> <span class="p">`</span><span class="nv">body</span><span class="p">`</span> <span class="n">then</span>
    <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>
</code></pre>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV30constructIdentOutResultHandler13successStatus8response10completionyxSg_q_Sg0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctAJ10IdentifierRzSeR_SER_r0_lFZ"></a>
                    <a name="//apple_ref/swift/Method/constructIdentOutResultHandler(successStatus:response:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV30constructIdentOutResultHandler13successStatus8response10completionyxSg_q_Sg0A9Contracts12RequestErrorVSgtc0A3Net14HTTPStatusCodeO_AA14RouterResponseCyyctAJ10IdentifierRzSeR_SER_r0_lFZ">constructIdentOutResultHandler(successStatus:<wbr>response:<wbr>completion:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a closure that can be called by a codable route handler that
 provides an optional <code>Identifier</code> id, optional <code>Codable</code> body and an optional <code><a href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a></code></p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will create a closure that can be passed to the registered
     route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">constructIdentOutResultHandler</span><span class="o">&lt;</span><span class="kt">IdType</span><span class="p">,</span> <span class="kt">OutputType</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">successStatus</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></span> <span class="o">=</span> <span class="o">.</span><span class="kt">OK</span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">IdentifierCodableResultClosure</span><span class="o">&lt;</span><span class="kt">IdType</span><span class="p">,</span> <span class="kt">OutputType</span><span class="o">&gt;</span> <span class="k">where</span> <span class="kt">IdType</span> <span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">OutputType</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>successStatus</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a></code> to use for a successful response (see below)</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> to which the id, codable response body (or codable
                   error) and status code will be written</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>completion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The completion to be called after the returned
                     closure completes execution.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The closure to pass to the codable route handler. The closure takes three arguments
        <code>(IdType?, OutputType?, RequestError?)</code>.
        If the third (error) argument is <code>nil</code> then the first (id) and second (body) arguments
        should both be non-<code>nil</code> and the response will be considered successful. If the third
        (error) argument is non-<code>nil</code> then the first and second arguments are ignored and the
        response is considered failed.</p>
<pre class="highlight swift"><code>    <span class="kt">If</span> <span class="n">successful</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="p">`</span><span class="nv">successStatus</span><span class="p">`,</span> <span class="n">the</span> <span class="p">`</span><span class="nv">IdentifierCodableResultClosure</span><span class="p">`</span> <span class="n">output</span>
    <span class="n">will</span> <span class="n">be</span> <span class="kt">JSON</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="p">,</span> <span class="n">and</span> <span class="n">the</span> <span class="p">`</span><span class="nv">Location</span><span class="p">`</span> <span class="n">header</span> <span class="n">of</span> <span class="n">the</span>
    <span class="n">response</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="n">the</span> <span class="nf">id</span> <span class="p">(</span><span class="n">by</span> <span class="n">converting</span> <span class="n">it</span> <span class="n">to</span> <span class="n">a</span> <span class="p">`</span><span class="nv">String</span><span class="p">`</span> <span class="n">using</span> <span class="n">its</span> <span class="p">`</span><span class="nv">value</span><span class="p">`</span> <span class="n">property</span><span class="p">)</span><span class="o">.</span>

    <span class="kt">If</span> <span class="n">failed</span><span class="p">,</span> <span class="n">the</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span> <span class="n">used</span> <span class="k">for</span> <span class="n">the</span> <span class="n">response</span> <span class="n">will</span> <span class="n">be</span> <span class="k">set</span> <span class="n">to</span> <span class="n">either</span> <span class="n">the</span>
    <span class="p">`</span><span class="nv">httpCode</span><span class="p">`</span> <span class="n">of</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`,</span> <span class="k">if</span> <span class="n">that</span> <span class="k">is</span> <span class="n">a</span> <span class="n">valid</span> <span class="kt">HTTP</span> <span class="n">status</span> <span class="n">code</span><span class="p">,</span> <span class="n">or</span>
    <span class="err">`</span><span class="kt">HTTPStatusCode</span><span class="o">.</span><span class="n">unknown</span><span class="err">`</span> <span class="n">otherwise</span><span class="o">.</span> <span class="kt">If</span> <span class="n">the</span> <span class="p">`</span><span class="nv">RequestError</span><span class="p">`</span> <span class="n">has</span> <span class="n">a</span> <span class="n">codable</span> <span class="p">`</span><span class="nv">body</span><span class="p">`</span> <span class="n">then</span>
    <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">encoded</span> <span class="n">and</span> <span class="n">sent</span> <span class="k">as</span> <span class="n">the</span> <span class="n">body</span> <span class="n">of</span> <span class="n">the</span> <span class="n">response</span><span class="o">.</span>
</code></pre>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV04readB19OrSetResponseStatus_4from8responsexSgxm_AA13RouterRequestCAA0kG0CtSeRzSERzlFZ"></a>
                    <a name="//apple_ref/swift/Method/readCodableOrSetResponseStatus(_:from:response:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV04readB19OrSetResponseStatus_4from8responsexSgxm_AA13RouterRequestCAA0kG0CtSeRzSERzlFZ">readCodableOrSetResponseStatus(_:<wbr>from:<wbr>response:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read data from the request body and decode as the given <code>InputType</code>, setting an error
 status on the given response in the case of failure.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will read the codable input object from the request that can be passed
     to a codable route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">readCodableOrSetResponseStatus</span><span class="o">&lt;</span><span class="kt">InputType</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">inputCodableType</span><span class="p">:</span> <span class="kt">InputType</span><span class="o">.</span><span class="k">Type</span><span class="p">,</span> <span class="n">from</span> <span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterRequest.html">RouterRequest</a></span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">InputType</span><span class="p">?</span> <span class="k">where</span> <span class="kt">InputType</span> <span class="p">:</span> <span class="kt">Decodable</span><span class="p">,</span> <span class="kt">InputType</span> <span class="p">:</span> <span class="kt">Encodable</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>inputCodableType</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>InputType.Type</code> (a concrete type complying to <code>Codable</code>)
                           to use to represent the decoded body data.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterRequest.html">RouterRequest</a></code> from which to read the body data.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> on which to set any error HTTP status codes in
                   cases where reading or decoding the data fails.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>An instance of <code>InputType</code> representing the decoded body data.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura14CodableHelpersV26parseIdOrSetResponseStatus_4from8responsexSgxm_AA13RouterRequestCAA0lH0Ct0A9Contracts10IdentifierRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/parseIdOrSetResponseStatus(_:from:response:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura14CodableHelpersV26parseIdOrSetResponseStatus_4from8responsexSgxm_AA13RouterRequestCAA0lH0Ct0A9Contracts10IdentifierRzlFZ">parseIdOrSetResponseStatus(_:<wbr>from:<wbr>response:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read an id from the request URL, setting an error status on the given response in the case of failure.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>This function is intended for use by the codable router or extensions
     thereof. It will read and id from the request that can be passed
     to a codable route handler.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">parseIdOrSetResponseStatus</span><span class="o">&lt;</span><span class="kt">IdType</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">idType</span><span class="p">:</span> <span class="kt">IdType</span><span class="o">.</span><span class="k">Type</span><span class="p">,</span> <span class="n">from</span> <span class="nv">request</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterRequest.html">RouterRequest</a></span><span class="p">,</span> <span class="nv">response</span><span class="p">:</span> <span class="kt"><a href="../Classes/RouterResponse.html">RouterResponse</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">IdType</span><span class="p">?</span> <span class="k">where</span> <span class="kt">IdType</span> <span class="p">:</span> <span class="kt">Identifier</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>idType</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>IdType.Type</code> (a concrete type complying to <code>Identifier</code>) to use
                 to represent the id.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>request</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterRequest.html">RouterRequest</a></code> from which to read the URL.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>response</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/RouterResponse.html">RouterResponse</a></code> on which to set any error HTTP status codes in
                   cases where reading or decoding the data fails.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>An instance of <code>IdType</code> representing the id.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2021 <a class="link" href="" target="_blank" rel="external">IBM &amp; Kitura project authors</a>. All rights reserved. (Last updated: 2021-01-25)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
